package cate.game.role.login.msg;

import cate.game.client.ClientContext;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgOutput;
import cate.game.client.msg.id.MsgIdBLogin;
import easy.java.dev.note.NoteField;
import lombok.ToString;

@ToString
public class RoleCreateResp implements MsgOutput {

    public static final int CODE_DONE = 0;
    public static final int CODE_PLEASE_RE_LOGIN = 1;
    public static final int CODE_REG_NAME_FAIL = 5;
    public static final int CODE_REG_LOGIN_FAIL = 2;
    public static final int CODE_NAME_ILLEGAL = 3;
    public static final int CODE_NAME_FORMAT_ERR = 4;
    public static final int CODE_ROLE_MAX_REACHED = 5;
    public static final int CODE_ACTION_REPEAT = 6;

    @NoteField(value = "执行结果代码", example = "1")
    public int code;
    @NoteField(value = "执行结果描述", example = "please re login")
    public String message;
    @NoteField(value = "玩家uid")
    public String roleId;

    @Override
    public MsgConfig conf() {
        return MsgIdBLogin.CREATE_ROLE_RESP;
    }

    public void send(ClientContext cc, int code, String message, String roleId) {
        this.code = code;
        this.message = message;
        this.roleId = roleId;
        cc.sendNow(this);
    }

}
